.class public final Llt/farmis/libraries/shape_import_android/readers/FamFileReader;
.super Llt/farmis/libraries/shape_import_android/readers/AbsFileReader;
.source "FamFileReader.kt"


# annotations
.annotation system Ldalvik/annotation/SourceDebugExtension;
    value = "SMAP\nFamFileReader.kt\nKotlin\n*S Kotlin\n*F\n+ 1 FamFileReader.kt\nlt/farmis/libraries/shape_import_android/readers/FamFileReader\n*L\n1#1,37:1\n*E\n"
.end annotation


# direct methods
.method public constructor <init>()V
    .locals 0

    .line 8
    invoke-direct {p0}, Llt/farmis/libraries/shape_import_android/readers/AbsFileReader;-><init>()V

    return-void
.end method


# virtual methods
.method public read(Ljava/lang/String;)Z
    .locals 7

    const-string v0, "fileText"

    invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 11
    invoke-interface {p1}, Ljava/lang/CharSequence;->length()I

    move-result v0

    const/4 v1, 0x1

    const/4 v2, 0x0

    if-nez v0, :cond_0

    const/4 v0, 0x1

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    :goto_0
    if-eqz v0, :cond_1

    return v2

    .line 15
    :cond_1
    invoke-virtual {p0}, Llt/farmis/libraries/shape_import_android/readers/AbsFileReader;->getMeasurementModels()Ljava/util/List;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/List;->clear()V

    .line 18
    :try_start_0
    new-instance v0, Lorg/json/JSONObject;

    invoke-direct {v0, p1}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    .line 19
    sget-object p1, Llt/farmis/libraries/shape_import_android/generators/FamMaker;->INSTANCE:Llt/farmis/libraries/shape_import_android/generators/FamMaker;

    invoke-virtual {p1}, Llt/farmis/libraries/shape_import_android/generators/FamMaker;->getTAG_MEASURES()Ljava/lang/String;

    move-result-object p1

    invoke-virtual {v0, p1}, Lorg/json/JSONObject;->getJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;

    move-result-object p1

    .line 20
    invoke-virtual {p1}, Lorg/json/JSONArray;->length()I

    move-result v0

    invoke-virtual {p0, v0}, Llt/farmis/libraries/shape_import_android/readers/AbsFileReader;->setTotalMeasurementCount(I)V

    .line 22
    invoke-virtual {p1}, Lorg/json/JSONArray;->length()I

    move-result v0

    sub-int/2addr v0, v1

    if-ltz v0, :cond_2

    const/4 v3, 0x0

    .line 23
    :goto_1
    invoke-virtual {p1, v3}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;

    move-result-object v4

    .line 24
    new-instance v5, Llt/farmis/libraries/shape_import_android/models/ShapeModel;

    const-string v6, "measure"

    invoke-static {v4, v6}, Lkotlin/jvm/internal/Intrinsics;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    invoke-direct {v5, v4}, Llt/farmis/libraries/shape_import_android/models/ShapeModel;-><init>(Lorg/json/JSONObject;)V

    .line 25
    invoke-virtual {p0}, Llt/farmis/libraries/shape_import_android/readers/AbsFileReader;->getMeasurementModels()Ljava/util/List;

    move-result-object v4

    invoke-interface {v4, v5}, Ljava/util/List;->add(Ljava/lang/Object;)Z
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    if-eq v3, v0, :cond_2

    add-int/lit8 v3, v3, 0x1

    goto :goto_1

    :cond_2
    return v1

    :catch_0
    move-exception p1

    .line 30
    invoke-virtual {p1}, Lorg/json/JSONException;->printStackTrace()V

    return v2
.end method
